const fs = require('fs');

try {
    // read contents of the file
    const data = fs.readFileSync('/Users/lu/Developments/csair-bot/scripts/proxies-raw', 'UTF-8');

    // split the contents by new line
    const lines = data.split(/\r?\n/);
    let num = 1
    // print all lines
    lines.forEach((line) => {
      const mod = num % 4
      if (mod == 1)
        console.log(`  - username: ${line}`)
      else if (mod == 2)
        console.log(`    password: ${line}`)
      else if (mod == 3)
        console.log('    server: http-proxy-t2.dobel.cn:9180')
      else if (mod == 0)
        console.log('    switch_ip_url: http://ip.dobel.cn/switch-ip')
      num++
    });
} catch (err) {
    console.error(err);
}